package com.wlyuan.open.scanner.utils.enums.bill;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 支付方式
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum PayModeEnum implements NamedValue<Integer> {

    CASH(1, 1, "现金"),
    TRANSFER(2, 2, "转账"),
    CHECK(3, 3, "支票"),
    CARD(4, 4, "油卡");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, PayModeEnum> MAP = new NamedValueMap<>(PayModeEnum.class);

    public static PayModeEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
